package comp.display 
{
	import flash.display.DisplayObjectContainer;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.text.TextFieldType;
	
	/**
	 * ...
	 * @author Qi Donghui
	 */
	public class TextArea extends DisplayComp 
	{
		private var _defaultTxt:String;
		
		private var _tformat:TextFormat;
		
		private var _txt:TextField;
		
		public function TextArea(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, defaultTxt:String = "", tformat:TextFormat = null) 
		{
			_defaultTxt = defaultTxt;
			_tformat = tformat;
			super(parent, xpos, ypos);			
		}
		
		override protected function init():void 
		{
			super.init();
			_txt = new TextField();
			_txt.multiline = true;
			_txt.type = TextFieldType.INPUT;
			_txt.border = true;
			addChild(_txt);
		}
		
		///////////////////////////////////
		// public methods
		///////////////////////////////////
		
		/**
		 * Draws the visual ui of the component.
		 */
		override public function draw():void
		{
			_txt.width = _width;
			_txt.height = _height;
		}
		
	}

}